import request from '@utils/request'
import axios from 'axios'

// 获取七牛
const getToken = async (data) => {
  return axios.get('https://www.yunnanyunyin.com/qiniu/getToken')
}

const getUrl = async (data) => {
  return axios.get(`https://www.yunnanyunyin.com/qiniu/uploadForm?resUrl=${data}`)
}

// isbn查询书籍信息
const getIsbn = async (data) => {
  // return axios.get(`https://api.jike.xyz/situ/book/isbn/${data.isbn}?apikey=13443.bc2fcda3451bf35cfd0f6ba93c806690.f70d3272751fc438e019ceeeacda8297`)
  // return axios.get(`https://www.changshayangli.cn:8055/user/GetShangPingdetile?isbn=${data.isbn}`)
  return request({
    url: '/user/GetShangPingdetileNew',
    method: 'get',
    data
  })
}

// 获取仓库所有的省
const getCkAllSheng = async (data) => {
  return request({
    url: '/cangku/GetAllSheng',
    method: 'get',
    data
  })
}

// 获取所有的省
const getAllSheng = async (data) => {
  return request({
    url: '/server/GetAllSheng',
    method: 'get',
    data
  })
}

// 获取所有的市
const getAllShi = async (data) => {
  return request({
    url: '/server/GetAllShi',
    method: 'get',
    data
  })
}

// 获取所有的区
const getAllqu = async (data) => {
  return request({
    url: '/server/GetAllqu',
    method: 'get',
    data
  })
}

// 保存城市权重
const UpdateCityYouxianji = async (data) => {
  return request({
    url: '/server/UpdateCityYouxianji ',
    method: 'post',
    data
  })
}

export { getToken, getIsbn, getUrl, getCkAllSheng, getAllSheng, getAllShi, getAllqu, UpdateCityYouxianji }
